home *** CD-ROM | disk | FTP | other *** search
/ POINT Software Programming / PPROG1.ISO / pascal / swag / win-os2.swg / 0023_Detection for WIN 3.X.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1994-01-27  |  2.3 KB  |  47 lines

  1. {***********************************************************************}
  2. PROGRAM Win3XInf;       {  Simple Detection routines for Windows 3.X    }
  3.                         {  Last Updated April 28/93, Greg Estabrooks    }
  4.  
  5. FUNCTION Win3X :BOOLEAN;  ASSEMBLER;
  6.                 {  Routine to determine if Windows is currently running }
  7. ASM
  8.   Mov AX,$4680                          {  Win 3.x Standard check       }
  9.   Int $2F                               {  Call Int 2F                  }
  10.   Cmp AX,0                              {  IF AX = 0 Win in real mode   }
  11.   JNE @EnhancedCheck                    {  If not check for enhanced mode}
  12.   Mov AL,1                              {  Set Result to true           }
  13.   Jmp @Exit                             {  Go to end of routine         }
  14. @EnhancedCheck:                         {  Else check for enhanced mode }
  15.   Mov AX,$1600                          {  Win 3.x Enhanced check       }
  16.   Int $2F                               {  Call Int 2F                  }
  17.   Cmp AL,0                              {  Check returned value         }
  18.   Je @False                             {  If not one of the below it   }
  19.   Cmp AL,$80                            {  is NOT installed             }
  20.   Je @False
  21.   Mov AL,1                              {  Nope it must BE INSTALLED    }
  22.   Jmp @Exit
  23. @False:
  24.   Mov AL,0                              {  Set Result to False          }
  25. @Exit:
  26. END;{Win3X}
  27.  
  28. FUNCTION WinVer :WORD;  ASSEMBLER;
  29.                 {  Returns a word containing the version of Win Running }
  30.                 {  Should only be used after checking for Win installed }
  31.                 {  Or value returned will be meaning less               }
  32. ASM
  33.   Mov AX,$1600                     {    Enhanced mode check             }
  34.   Int $2F                          {    Call Int 2F                     }
  35. END;{WinVer}
  36.  
  37. BEGIN
  38.   IF Win3X THEN                         {  If it is running say so      }
  39.    BEGIN
  40.     Writeln('Windows is Running! ');    {  Now display version running  }
  41.     Writeln('Version Running is : ',Lo(WinVer),'.',Hi(WinVer));
  42.    END
  43.   ELSE                                  {  If not 'Just say NO!'        }
  44.     Writeln('Windows is not Running!');
  45. END.
  46. {***********************************************************************}
  47.